<template>
  <div class="sidebar" :class="{ open: isOpen }">
    <button @click="toggleSidebar">Toggle</button>
    <div class="sidebar-content">
      <h3>Sidebar</h3>
      <p>This is a sidebar content.</p>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      isOpen: false,
    }
  },
  methods: {
    toggleSidebar() {
      this.isOpen = !this.isOpen
    },
  },
}
</script>

<style scoped>
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 250px;
  height: 100%;
  background-color: #333;
  color: #fff;
  transition: transform 0.3s ease;
  transform: translateX(-100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.sidebar.open {
  transform: translateX(0);
}

.sidebar button {
  position: absolute;
  top: 10px;
  right: -40px;
  background-color: #333;
  color: #fff;
  border: none;
  padding: 10px;
  cursor: pointer;
}

.sidebar-content {
  text-align: center;
}
</style>
